<template>
  <div class="page">
    <el-form :inline="true">
      <el-form-item label="用户id">
        <el-input
          v-model="queryParams.uid"
          placeholder="请输入用户ID"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="query">查询</el-button>
      </el-form-item>
    </el-form>

    <el-table :data="list" border>
      <el-table-column label="序号" type="index"></el-table-column>
      <el-table-column label="ID" prop="id"></el-table-column>
      <el-table-column label="用户ID" prop="uid"></el-table-column>
      <el-table-column label="备注" prop="content"></el-table-column>
      <el-table-column label="总贡献值" prop="allmoney"></el-table-column>
      <el-table-column label="剩余贡献值" prop="shengmoney"></el-table-column>
      <el-table-column label="已释放贡献值" prop="maxmoney"></el-table-column>
      <el-table-column label="时间" prop="addDate"></el-table-column>
    </el-table>

    <pagination
      background
      @current-change="getData"
      :current-page="queryParams.pageNum"
      :page-size="queryParams.pageSize"
      layout="total, prev, pager, next, jumper"
      :total="total"
    ></pagination>
  </div>
</template>
<script>
import { userReward } from "@/api/ds/user";

export default {
  components: {},
  props: {},
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        uid: "",
      },
      list: [],
      total: 0,
    };
  },
  computed: {},
  watch: {},
  created() {
    this.getData();
  },
  methods: {
    query() {
      this.queryParams.pageNum = 1;
      this.getData();
    },
    async getData() {
      let res = await userReward(this.queryParams);
      if (res.code === 200) {
        console.log("res", res);
        this.list = res.rows;
        this.total = res.total;
      }
    },
  },
  mounted() {},
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  activated() {},
  deactivated() {},
};
</script>
<style lang="scss" scoped>
.page {
  box-sizing: border-box;
  padding: 20px;
}
</style>
